package com.org.redis.pubandsub;

import redis.clients.jedis.JedisPubSub;

/**
 * @author wang
 */
public class MyJedisPubSub extends JedisPubSub {

    @Override
    public void onMessage(String channel, String message) {
        System.out.println("收到消息：" + message);
    }

    @Override
    public void onSubscribe(String channel, int subscribedChannels) {
        System.out.println(Thread.currentThread().getName() + "订阅--->" + channel + "--->" + subscribedChannels);
    }

    @Override
    public void onUnsubscribe(String channel, int subscribedChannels) {
        System.out.println(Thread.currentThread().getName() + "取消订阅--->" + channel + "--->" + subscribedChannels);
    }
}
